<template>
 <div :class="isActive ? 'active' : ''">
	 
 </div>
 <button @click="onClick()">点击换色</button>
</template>

<script setup>
	import { ref } from 'vue';
	
	
	let isActive = ref(false)
	const onClick = ()=>{
		alert('点击了')
		isActive.value = !isActive.value
	}
</script>

<style scoped>
.active{
	width: 200px;
	height: 200px;
	background: red;
}
</style>
